<template>
  <div class="createComponents">
    <h1>封装组件</h1>
    <loading :visible='visible'></loading>
    <div>
      <el-button type="primary" @click="clickLoading">显示loading组件</el-button>
    </div>
    <div>
      <el-button type="success" @click="clickNotice">显示Notice组件</el-button>
    </div>
  </div>
</template>

<script>
import { log } from 'util';
export default {
  name: "app",
  data() {
    return {
      visible: false
    };
  },
  methods: {
    clickNotice() {
      this.createNotice({
        title: "提示",
        content: "Notice组件",
        duration: 2000
      });
    },
    clickLoading() {
      // console.log(11);
      
     this.visible=true
      // this.$store.commit("vuex/setLoadingVisble",true)
      setTimeout(() => {
      this.visible=false
      }, 3000);
    },
    // closeLoading(){
    //   console.log(12121);
      
    //   this.visible=false
    //   this.$forceUpdate()
    // }
  }
};
</script>

<style lang="less" scoped>
</style>

